const App = getApp();
const navigationBarHeight = (getApp().diygwstatusBarHeight + 44) + 'px'
Page({
    data: {
        msgs1: [],
        url: App.Config.basePath
    },

    showModal(message) {
        App.WxService.showModal({
            title: '友情提示',
            content: message,
            showCancel: !1,
        });
    },
    onShareAppMessage: function () {
    },
    onLoad(option) {
        if (option) {
            this.setData({
                globalOption: option
            })
        }
    },
    onShow() {
        this.getMsgs1();
    },
    navigateTo(e) {
        App.navigateTo(e.currentTarget.dataset.url, e.currentTarget.dataset);
    },
    delData1(e) {
        const dataset = e.currentTarget.dataset;
        let param = {
            f: 1,
            id: dataset.id
        };
        App.WxService.showModal({
            title: '友情提示',
            content: '确定要删除吗？',
        }).then(data => {
            if (data.confirm == 1) {
                App.HttpService.delData(param, "/mreads_Delete").then(data => {
                    App.WxService.showToast({
                        title: "删除成功!",
                        icon: 'success',
                        duration: 1500,
                    });
                    setTimeout(function () {

                    }, 1500)

                    this.getMsgs1();
                });
            }
        })
    },
    getMsgs1() {

        //调用数据
        let param = {
            f: 1,
            mid: wx.getStorageSync('mid'),
            loadmsg: `正在加载中`
        };


        App.HttpService.getData(param, "/mreads_List").then(data => {
            this.setData({
                msgs1: data
            });
        });
    }

})
